package day6.zy3;

import java.util.Scanner;

public class Test extends Thread {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Test t = new Test();
        t.start();
        System.out.println("请输入用户名：");
        String name = in.next();
        System.out.println("请输入密码：");
        String pwd = in.next();
        while (true) {
            if ("admin".equals(name) && "admin".equals(pwd)) {
                System.out.println("欢迎光临");
            } else {
                System.out.println("用户名或密码错误");
            }
        }
    }

    @Override
    public void run() {
        try {
            sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.exit(1);
    }
}
